<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../common/include/header.jsp" %>
<%-- 커뮤니티 메인페이지 --%>
<div width="980px">
<table border="0" cellpadding="0" cellspacing="0" width="980px">
	<tr><td style="vertical-align: top;width: 180px;background-color: #fdb73a;">
		<table border="0" cellpadding="0" cellspacing="0">
	
	<tr><td style="height: 20px;"><img src="<%=imagePath %>left_01.jpg"/></td></tr>
	<tr><td style="height: 20px;"><img src="<%=imagePath %>left_comm.jpg"/></td></tr>
			<logic:notEmpty name="communityForm" property="memberCommunitys">			
	<tr><td style="height: 20px;background-image: url('<%=imagePath %>left_02.jpg');text-align: center;padding-top:2px;">
			<form name="urlForm">
					<select name="url" onchange="changeUrl()" style="width: 140px;height: 18px;font-size: 8pt;">
						<logic:iterate id="mc" name="communityForm" property="memberCommunitys" type="model.MemberCommunity">
							<option value="<bean:write name="mc" property="cono"/>"><bean:write name="mc" property="coname"/></option>
						</logic:iterate>
					</select>		
			</form>				
		</td></tr>		
			</logic:notEmpty>
	<tr><td style="height: 20px;background-image: url('<%=imagePath %>left_02.jpg');text-align: center;" class="leftlink">
			<html:link action="/communityinfo.do?method=createForm" onclick="return check()" styleClass="la">동호회 개설 신청</html:link>
				</td></tr>
	<tr><td style="height: 20px;"><img src="<%=imagePath %>left_03.jpg"/></td></tr>
				</table>
	</td>	
<!-- 오른쪽 메인 화면 -->
	<td style="width: 800px;text-align: center;">
	<div style="width: 800px;height: 100px;">
		<img src="<%=imagePath %>comm_banner_01x800.jpg"/>
	</div>
			<table style="width: 700px;" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td style="width: 700px;text-align: center;">
						<table border="0" width="700px" cellpadding="0" cellspacing="0">
							<tr>
								<td colspan="2" style="width: 700px;text-align: center;">
								<!-- 금주의 동호회 -->
									<table style="width: 700px;height: 150px;" cellpadding="0" cellspacing="0">
										<tr>
											<td style="height:40px;vertical-align: top;"><img src="<%=imagePath %>comm_01.jpg"/></td></tr>
										<tr>
											<td style="background-image: url('<%=imagePath %>comm_02.jpg');height:110px;">
											
	<table style="width: 690px;height: 100px;" cellpadding="0" cellspacing="0">
		<tr><td rowspan="3" style="text-align: center;width: 300px;height: 100px;"> 
		<logic:notEmpty name="communityForm" property="cologosfn">
			<img src="<%=path%>/uploadfiles/<bean:write name="communityForm" property="cologosfn"/>"  class="commImg"/>
		</logic:notEmpty>
		<logic:empty name="communityForm" property="cologosfn">
			<img src="<%=imagePath %>comm_03.jpg" class="commImg"/>
		</logic:empty>
			</td>
			<td class="commTd">
			<a href="<%=path%>/community/community.do?cono=<bean:write name="communityForm" property="cono"/>"><bean:write name="communityForm" property="coname"/></a></td></tr>
			
		<tr><td class="commTd">관리자 : 
		<a href="javascript:;" onmousedown="popmenu1('<bean:write name="communityForm" property="mid"/>')">
		<bean:write name="communityForm" property="mid"/></a>&nbsp;|&nbsp;
		개설일 (<bean:write name="communityForm" property="coregdate"/>)&nbsp;|&nbsp;
		회원수 (<bean:write name="communityForm" property="count"/>명)</td></tr>
		<tr><td style="height: 60px;vertical-align: top; text-align: left;padding-left: 10px;word-break:break-all;">
		동호회 소개글 : <bean:write name="communityForm" property="coguide"/>
		</td></tr>
	</table>
											
											</td>
										</tr>
									</table>
									
								</td>
							</tr>
							<tr>
								<td style="width: 350px;text-align: left;height: 150px;padding-top: 10px;">
<!-- 인기 동호회 -->
									<table style="width: 345px;height: 150px;text-align: center;" cellpadding="0" cellspacing="0">
										<tr>
											<td style="width: 345px;height: 40px;"><img src="<%=imagePath %>comm_04.jpg"/></td>
										</tr>
										<tr>
											<td style="width: 345px;height:110px;background-image: url('<%=imagePath %>comm_05.jpg');">
												<table style="width: 340px;" cellpadding="0" cellspacing="0">
												<tr><td colspan="3" style="width: 340px;height: 20px;"><img src="<%=imagePath %>comm_08.jpg"/></td></tr>
												<logic:iterate id="populCommunity" name="communityForm" property="populCommunity" type="model.Community">
													<tr>
														<td class="commPopulTd" style="width: 100px;">[<bean:write name="populCommunity" property="coregdate"/>]</td>
														<td class="commPopulTd" style="width: 190px;">
															<a href="<%=path%>/community/community.do?cono=<bean:write name="populCommunity" property="cono"/>"><bean:write name="populCommunity" property="coname"/></a></td>
														<td class="commPopulTd" style="width: 50px;text-align: right;padding-right: 6px;">[<bean:write name="populCommunity" property="membercount"/>명]</td>
													</tr>
												</logic:iterate>
												</table>
											</td>
										</tr>
									</table>
								</td>
								<td style="width: 350px;text-align: right;height: 150px;padding-top: 10px;">
<!-- 신설 동호회 -->
									<table style="width: 345px;height: 150px;text-align: center;" cellpadding="0" cellspacing="0">
										<tr>
											<td style="width: 345px;height: 40px;"><img src="<%=imagePath %>comm_06.jpg"/></td>
										</tr>
										<tr>
											<td style="width: 345px;height:110px;background-image: url('<%=imagePath %>comm_05.jpg');">
												<table style="width: 340px;" cellpadding="0" cellspacing="0">
												<tr><td colspan="3" style="width: 340px;height: 20px;"><img src="<%=imagePath %>comm_08.jpg"/></td></tr>
												<logic:iterate id="newCommunity" name="communityForm" property="newCommunity" type="model.Community">
													<tr>
														<td class="commPopulTd" style="width: 100px;">[<bean:write name="newCommunity" property="coregdate"/>]</td>
														<td class="commPopulTd" style="width: 190px;">
															<a href="<%=path%>/community/community.do?cono=<bean:write name="newCommunity" property="cono"/>"><bean:write name="newCommunity" property="coname"/></a></td>
														<td class="commPopulTd" style="width: 50px;text-align: right;padding-right: 6px;">[<bean:write name="newCommunity" property="membercount"/>명]</td>
													</tr>
												</logic:iterate>
												</table>
											</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td style="width: 700px;text-align: center;padding-top: 10px;padding-bottom: 30px;" colspan="2">
									<table style="width: 700px;" cellpadding="0" cellspacing="0">
										<tr>
											<td id="searchComm" colspan="2" style="width: 700px;height: 40px;padding: 0px;background: url('<%=imagePath %>comm_07.jpg');" onclick="goSearch()" onmouseover="setCursor()">			
											</td>
										</tr>
										<tr>
											<td colspan="2" style="border: 1px solid #fdb73a;padding: 5px;">
												<table border="0" width="660px" cellpadding="0" cellspacing="0">
												<%int i=0;%>
												<tr>
												<logic:iterate id="sortCommunity" name="communityForm" property="sortCommunity" type="model.Community">													
													<%if(i==4){%>
														</tr><tr>
													<%}%>
													<td style="width: 140px"><a href="<%=path%>/community/communityfind.do?method=communityFind&ccno=<bean:write name="sortCommunity" property="ccno"/>&coname="><bean:write name="sortCommunity" property="ccname"/>(<bean:write name="sortCommunity" property="ccnocount"/>)</a></td>
													<%i++;%>
												</logic:iterate>
												</tr>
												</table>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<script type="text/javascript">
	function changeUrl(){
		var selectedIndex = window.document.urlForm.url.selectedIndex;
		if(selectedIndex==0){}
		else{
			var url=window.document.urlForm.url.options[selectedIndex].value;
			if(url!=0){
				url = '<%=path%>/community/community.do?cono='+url;
				window.open(url,"_self");
			}
		}
	}
	
	function check(){
		<%	boolean check = user.isLogon();
			if(check){	%>
				return true;
		<%	}else{	%>
				alert("로그인 후 이용가능 합니다.");
				return false;
		<%	}	%>
	}
	
	function goSearch(){
		location.href="<%=path%>/community/communityfind.do?method=communityFind&ccno=0&coname=";
	}
	
	function setCursor(){
		searchComm.style.cursor = "hand";
	}
</script>
</div>
<%@ include file="../common/include/footer.jsp" %>

